<?php

namespace App\Models\Api\v1;

use Illuminate\Database\Eloquent\Model;

class Message extends Model
{
    protected $table = 'message';
    const CREATED_AT = 'create_time';
    const UPDATED_AT = 'update_time';
    protected $fillable = [
        'uid',
        'fid',
        'content'
    ];

    public static function createMessage($data, $fid,$uid)
    {
        self::query()->create([
            'content' => $data,
            'fid' => $fid,
            'uid' => $uid??auth('api')->id()
        ]);
        return true;
    }
}
